#include "user.h"


User::User()
{
}

User::User(QString id)
{
    this->userID=id;
}

User::User(const QString &id, const int &initialType)
{
    this->userID = id;
    this->type = initialType;
}

int User::getType() const
{
    return type;
}

void User::setType(int newType)
{
    type=newType;
}

QString User::getUserID() const
{
    return userID;
}

void User::setUserID(QString newID)
{
    userID=newID;
}

QDataStream &operator<<(QDataStream &out, const User &data)
{
   out << quint32(data.getType()) << data.getUserID();
   return out;
}

QDataStream &operator>>(QDataStream &in, User &data)
{
    QString userID;
    quint32 type;
    in >> type >> userID;
    data = User(userID, type);
    return in;
}
